<?php
include_once "../init.inc.php";
include_once "header.php";
//include_once "tbs_load.php";


$cat = $_GET['cat'];
$search = $_GET['search'];
$type = $_GET['type'];
$id = (int)$_GET['id'];

?>

    <a href="#"  onclick="history.back(); return false;" ><i class="icon-arrow-left"></i>&nbsp;Назад</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a id ="alltocart" class="btn btn-success" href="#" onclick="addall(); return false;"><i class="icon-shopping-cart icon-white"></i>&nbsp;Add to cart</a>
    <span class="text-info"><b>&nbsp;or&nbsp;</b></span>
    <a class="btn btn-primary" href="tbs_load.php?rewrite=<?=$id ?>"><i class="icon-pencil icon-white"></i>&nbsp;Rewrite</a>
    <a class="btn btn-primary" href="tbs_load.php?everyones=<?=$id ?>"><i class="icon-arrow-down icon-white"></i>&nbsp;Download in Spintax</a>&nbsp;
    
<?php
if ($_GET['id']){
   $id = (int)$_GET['id'];
   
   $sql = "SELECT p.ID, p.post_date, p.post_content, p.post_title, p.prem, p.words, c.cat_name
            FROM `posts` as p 
            LEFT JOIN `relations` AS r ON p.ID = r.post_id
            LEFT JOIN `category` AS c ON r.cat_id = c.ID
            WHERE p.ID = $id ";
 
   $result = mysql_query($sql) or die('Error, insert query failed');
    
   $row = mysql_fetch_assoc($result);
     $title = $row['post_title'];
     
            $text = nl2br($row['post_content']);
  ?> 
   
<div id="file-content">

            <h1><?php echo $title  ?></h1><br> 
            <?php echo $text;  ?>
            
          
</div>

 
 <?php  
}

?>

   
         <?php //echo "<script>location.href=\"index.php?cat=$cat&amp;type=$type&amp;search=$search\";</script>"; ?>
    <h4 class = "license text-info">License:</h4>
     <p class = "license">[YES] Sell Each Product Individually.<br>
        [YES] Sell All The Products As A package.<br>
        [YES] Sell Resell Rights.<br>
        [YES] Sell Private Label Rights.<br>
        [YES] Sell At Online Auctions.<br>
        [YES] Give Away.<br>
        [YES] Give Away Resell Rights.<br>
        [YES] Give Away Private Label Rights.<br>
        [YES] Offer As A Bonus.<br>
        [YES] Offer As Subscriber Incentives.<br>
        [YES] Charge Any Price YOU Want.<br>
        [YES] Add Them To Membership Sites.<br>
        [YES] Create BRAND NEW Products<br>
        [YES] Change And Publish The Products Offline<br>
        [YES] Put Your Name On The Products As The Author<br><br>
     
         <span class="lead text-info">Does this product violates the license terms?</span> &nbsp;&nbsp; <a class="btn btn-danger" href="#"><i class="icon-warning-sign icon-white"></i>&nbsp;Report</a>&nbsp;         
     </p>
 <?php

        include_once "footer.php"; 



?>
        
